﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Demo14_1_2
{
    
    internal class Program
    {
        private static Semaphore sem = new Semaphore(1,10);
        static void Main(string[] args)
        {
            for (int i = 0; i < int.MaxValue; i++) 
            {
                sem.Release();
                Console.WriteLine("当前值为");
                Debugger.Break();
            }
        }
    }
}
